if [ $# -ne 3 ]; then
	  echo "The 1st arg is the ext name."
	  echo "The 2nd arg is substring those filename contains"
	  echo "The 3nd arg is the output files"
	  echo "This only works in the current dirrectory"
	  exit
fi 
if  test -s $3; then
	echo "$3 exists and will be deleted"
fi
echo "Gat all $1 files with $2 and output to $3"
#CUR_DIR=$PWD
#cd $(dirname $1)
tmpfile=tmpfile.tmp
for file in $(ls *$1 | grep $2); do
	cat $file >> $tmpfile
	\rm $file
done
if ! test -s $tmpfile ; then
	echo "Mapping file is not found or emtpy!"
fi
mv $tmpfile $3
#cd $CUR_DIR


